package org.chnxi.study.serialize.jackson;

import com.fasterxml.jackson.annotation.JsonIdentityInfo;
import com.fasterxml.jackson.annotation.ObjectIdGenerators;
import lombok.Data;

@Data
@JsonIdentityInfo(generator = ObjectIdGenerators.IntSequenceGenerator.class, property = "@id")
public class HeadTeacher implements Teacher {

    private String name;

    public HeadTeacher(){
        this.name = "班主任";
    }

    @Override
    public String name() {
        System.out.println("班主任");
        return name;
    }

    @Override
    public String toString() {
        return JSONUtil.object2String(this);
    }
}
